import 'package:convergence_media/features/api/apis/circle_csavs_api.dart';
import 'package:convergence_media/features/config/logger/logger.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'video_catgory.g.dart';

@riverpod
FutureOr<List<String>> videoCatgory(VideoCatgoryRef ref) async {
  final circleCsavsApi = ref.watch(circleCsavsApiProvider);
  try {
    final getCatgoryResponse = await circleCsavsApi.getGetCatgory();

    logger.t(getCatgoryResponse);
    return getCatgoryResponse.data.map((e) => e.title).toList();
  } catch (e, s) {
    logger.e(e, stackTrace: s);
  }
  return [];
}
